function b11 = zFC_ScaleInExternalInstrument(Sigma, relative_ImpulseVector)

% -----------------------------------------------------%
% DESCRIPTION OF THE FUNCTION
% In a VAR identified with external instruments, it takes the impulse
% vector "relative_ImpulseVector" identified only up to a scale and
% computes the scale "b11". The final impulse vector is then "b11 *
% relative_ImpulseVector"
% -----------------------------------------------------%



assert( size(relative_ImpulseVector,2) == 1  ) 
assert( size(Sigma,1) == size(relative_ImpulseVector,1)  ) 

mu = relative_ImpulseVector(2:end);

Sigma11 = Sigma(1,1);
Sigma21 = Sigma(2:end,1);
Sigma22 = Sigma(2:end,2:end);

gamma = Sigma22 + Sigma11*mu*mu' - Sigma21*mu' - mu*Sigma21';
b12_squared = (Sigma21 - Sigma11*mu)'*gamma^(-1)*(Sigma21 - Sigma11*mu);
b11 = sqrt(Sigma11 - b12_squared);


end
